package com.xbongbong.saas.domain.dao;

import com.xbongbong.saas.domain.entity.DingReportEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author chenshan
 * @Since 2020-09-01 13:57
 */
@Repository
@Mapper
public interface DingReportDao {
	Integer insert(DingReportEntity dingReportEntity);

	void insertBatch(List<DingReportEntity> dingReportList);

	Integer update(DingReportEntity dingReportEntity);

	Integer deleteByKey(@Param("key") Long key, @Param("corpid") String corpid);
	
    Integer deleteByRecordTime(@Param("corpid") String corpid,@Param("type") Integer type,@Param("openConversationId")String openConversationId,@Param("recordTimeStart") Long recordTimeStart, @Param("recordTimeEnd") Long recordTimeEnd);
    
	DingReportEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid);

	List<DingReportEntity>	findEntitys(@Param("param") Map<String, Object> param);

	Integer getEntitysCount(@Param("param") Map<String, Object> param);

	Integer deleteByIdIn(@Param("idIn") List<Long> idIn, @Param("corpid") String corpid);
	
	Integer updateBatch(@Param("list") List<DingReportEntity> dingReportList,@Param("corpid") String corpid);

	Integer dataConsistencyUpdateUser(@Param("corpid") String corpid, @Param("userId") String userId, @Param("name") String name, @Param("avatar") String avatar);

}